package cn.tedu.wufl.xcw.adapter.exception;

import cn.tedu.wufl.xcw.adapter.response.AppCode;
import lombok.Getter;

@Getter
public class BusinessException extends RuntimeException{
    private int code;
    private String msg;

    public BusinessException(AppCode appCode, String message) {
        super(message);
        this.code = appCode.getCode();
        this.msg = appCode.getMsg();
    }
    public BusinessException(AppCode appCode){
        this.code = appCode.getCode();
        this.msg = appCode.getMsg();
    }

    public BusinessException(String message){
        super(message);
        this.code = AppCode.APP_ERROR.getCode();
        this.msg = AppCode.APP_ERROR.getMsg();
    }





}
